﻿namespace Borg.Framework
{
    [Extension("Borg.Framework")]
    [Plug("Startup")]
    [ParamValue("ExecuteInMainThread", true, new string[] { })]
    internal class Startup : IStartup
    {
        public void Run()
        {
            SlotOpenHistory.Init();
            PreferencesStartup.Register();

            new ReplaceRegisterStartup().Init();
            new ReplacePlugStartup().Init();
            new DependentPlugStartup().Init();
            new QueuePlugsStartup().Init();

            var extensionInfo = Runtime.GetExtensionInfo(this);

            if (Runtime.Arguments.ContainsKey("script"))
                ScriptReader.ExecuteScript(Runtime.Arguments["script"], extensionInfo);

            extensionInfo.Release();
        }
    }
}

